import request from '@/utils/request'
import axios from 'axios'
export const test = ' http://127.0.0.1:8000'
// export function login(data) {
//   return request({
//     url: '/user/login',
//     method: 'post',
//     data
//   })

export const login = params => { return axios.post(`${test}/api/user/login_action/`, params).then(res => res.data)}
export const project_list = params => { return axios.get(`${test}/api/project/project_list`, params).then(res => res.data)}
// export function login(data) {
//   return request({
//     url: '/api/user/login_action',
//     method: 'post',
//     data
//   })
// }
export function getInfo(token) {
  return request({
    url: '/api/user/login',
    method: 'post',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}
